{#**
 * 2007-2020 PrestaShop SA and Contributors
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * https://opensource.org/licenses/OSL-3.0
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@prestashop.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please refer to https://www.prestashop.com for more information.
 *
 * @author    PrestaShop SA <contact@prestashop.com>
 * @copyright 2007-2020 PrestaShop SA and Contributors
 * @license   https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
 * International Registered Trademark & Property of PrestaShop SA
 *#}
{% if form.suppliers|length > 0 %}
  <div id="form_step6_suppliers_custom_fields">
    <h2>{{ form.suppliers.vars.label }}</h2>
    <div class="row mb-1">
      <div class="col-md-12">
        <div class="alert expandable-alert alert-info" role="alert">
          <button type="button" class="read-more btn-link" data-toggle="collapse" data-target="#suppliersInfo" aria-expanded="false" aria-controls="collapseDanger">
            {{ 'Read more'|trans({}, 'Admin.Actions')|raw }}
          </button>
          <p class="alert-text">
            {{ 'This interface allows you to specify the suppliers of the current product and its combinations, if any.'|trans({}, 'Admin.Catalog.Help')|raw }}<br>
            {{ 'You can specify supplier references according to previously associated suppliers.'|trans({}, 'Admin.Catalog.Help')|raw }}
          </p>
          <div class="alert-more collapse" id="suppliersInfo">
            <p>
              {{ 'When using the advanced stock management tool (see Shop Parameters > Products settings), the values you define (price, references) will be used in supply orders.'|trans({}, 'Admin.Catalog.Help')|raw }}
            </p>
          </div>
        </div>
      </div>
    </div>

    <div class="panel panel-default">
      <div class="panel-body">
        <div>
          {{ form_errors(form.suppliers) }}
          <table class="table" id="form_step6_suppliers">
            <thead class="thead-default">
            <tr>
              <th width="70%">{{ 'Choose the suppliers associated with this product'|trans({}, 'Admin.Catalog.Feature') }}</th>
              <th width="30%">{{ 'Default supplier'|trans({}, 'Admin.Catalog.Feature') }}</th>
            </tr>
            </thead>
            <tbody>
            {% for key, supplier in form.suppliers %}
              <tr>
                <td>{{ form_widget(supplier) }}</td>
                <td>{{ form_widget(form.default_supplier[key]) }}</td>
              </tr>
            {% endfor %}
            </tbody>
          </table>
        </div>
      </div>
    </div>

  </div>
{% endif %}
